package com.gourd;

import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation;
import com.alicp.jetcache.anno.config.EnableMethodCache;
import com.github.jackieonway.sms.annotion.EnabledSmsAutoConfiguration;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.context.request.RequestContextListener;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @author gourd
 */
@EnableTransactionManagement
@EnableSwagger2
@EnableMethodCache(basePackages = "com.gourd")
@MapperScan("com.gourd.*.*.dao")
@EntityScan
@EnableCreateCacheAnnotation
@EnableScheduling
@EnabledSmsAutoConfiguration
@SpringCloudApplication
@EnableZuulProxy
@Slf4j
@EnableFeignClients
public class IndexApplication {


    public static void main(String[] args) {
        SpringApplication.run(IndexApplication.class, args);
        log.warn("gourd服务启动成功！温馨提示：代码千万行，注释第一行，命名不规范，同事泪两行");
    }

    @Bean
    public RequestContextListener requestContextListener(){
        return new RequestContextListener();
    }
}
